package com.github.jcooky.structure;

public interface NodeList extends List {
	public abstract class Node {
		public abstract Object element();
		protected abstract void setElement(Object e);
		protected abstract void setPrev(Node p);
		protected abstract void setNext(Node p);
		public abstract Node getPrev();
		public abstract Node getNext();
	}
	
	int size();
	boolean isEmpty();
	
	Node first();
	Node last();
	Node prev(Node p);
	Node next(Node p);
	
	void set(Node p, Object e);
	void addBefore(Node p, Object e);
	void addAfter(Node p, Object e);
	void addFirst(Object e);
	void addLast(Object e);
	Object remove(Node p);
}
